import java.awt.GraphicsEnvironment;
import java.awt.geom.RoundRectangle2D;

import javax.swing.JFrame;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;

public class MStyleFrame {

	@SuppressWarnings("restriction")
	public MStyleFrame(JFrame frame) {
		try {
			UIManager
					.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel");
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
		} catch (InstantiationException e) {
			e.printStackTrace();
		} catch (IllegalAccessException e) {
			e.printStackTrace();
		} catch (UnsupportedLookAndFeelException e) {
			e.printStackTrace();
		}
		if ((com.sun.awt.AWTUtilities
				.isTranslucencySupported(com.sun.awt.AWTUtilities.Translucency.PERPIXEL_TRANSLUCENT))
				&& (com.sun.awt.AWTUtilities
						.isTranslucencyCapable(GraphicsEnvironment
								.getLocalGraphicsEnvironment()
								.getDefaultScreenDevice()
								.getDefaultConfiguration()))) {

			com.sun.awt.AWTUtilities.setWindowOpaque(frame, false);
			com.sun.awt.AWTUtilities.setWindowOpacity(frame, 0.80f);
			com.sun.awt.AWTUtilities.setWindowShape(frame,new RoundRectangle2D.Float(0, 0, frame.getWidth(), frame.getHeight(), 20f, 20f));

		}
		;

	}
}
